package Basic.day02;

public class VarDemo {

    public static void main(String[] args) {
        //声明变量
        int a;
        //声明并赋值
        int b = 10;
        //声明多个变量
        int c, d, e;
        //声明并赋值多个变量
        int f = 20, g = 30, h = 40;

        int i = 5;
        int l = i + 10;
        System.out.println("l = " + l);
        System.out.println("字符l");

        int money = 5000;
        money += 1000; //存款
        System.out.println("存款后money = " + money);
        money -= 300; //取款
        System.out.println("取款后money = " + money);

        // 整数类型的取值范围
        System.out.println("byte取值范围：" + Byte.MIN_VALUE + " ~ " + Byte.MAX_VALUE);
        System.out.println("short取值范围：" + Short.MIN_VALUE + " ~ " + Short.MAX_VALUE);
        System.out.println("int取值范围：" + Integer.MIN_VALUE + " ~ " + Integer.MAX_VALUE);
        System.out.println("long取值范围：" + Long.MIN_VALUE + " ~ " + Long.MAX_VALUE);
        // 浮点数类型的取值范围
        System.out.println("float取值范围：" + Float.MIN_VALUE + " ~ " + Float.MAX_VALUE);
        System.out.println("double取值范围：" + Double.MIN_VALUE + " ~ " + Double.MAX_VALUE);
        // 字符类型的取值范围
        System.out.println("char取值范围：" + (int)Character.MIN_VALUE + " ~ " + (int)Character.MAX_VALUE);
        // 布尔类型的取值范围
        System.out.println("boolean取值范围：" + Boolean.TRUE + " ~ " + Boolean.FALSE);
    }
}
